<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>第一个vue实例</title>
</head>
<body>
    <script src="/js/vue.js"></script>
    <div id="app">
        <p>{{msg}}</p>
    </div>

    <script>
        //1. 创建vue实例
        let app = new Vue({
            // 键值对
            el:"#app",//"字符串"，根标签
            data:{ //对象，Vue 实例的数据对象
                msg:'hello world'
            }
        })

        app.$age = 10 // 自己创建全局属性
        console.log(app.$data.msg);
        console.log(app.msg)
        //app.msg
        console.log(app.$age);//自定义全局变量
    </script>   
</body>
</html>